#! /usr/bin/make -f
#
# debian/Makefile
# Part of Debian ‘inform6-compiler’ package.
#
# Copyright © 2015–2016 Ben Finney <ben+debian@benfinney.id.au>
#
# This is free software; you may copy, modify, and/or distribute this
# work under the terms of the GNU General Public License as published
# by the Free Software Foundation; version 3 of that License or later.
# No warranty expressed or implied.
# See the file ‘/usr/share/common-licenses/GPL-3’ for details.

header_files = header.h
module_sources = $(wildcard *.c)
modules = $(patsubst %.c,%.o,${module_sources})
GENERATED_FILES += ${modules}

program = inform6
GENERATED_FILES += ${program}

.PHONY: all
all: ${program}

${program}: ${modules}
	$(CC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o "$@" $^

%.o: %.c
	$(CC) ${CFLAGS} ${CPPFLAGS} -c -o "$@" "$<"

.PHONY: clean
clean:
	$(RM) ${GENERATED_FILES}


# Local variables:
# mode: makefile
# coding: utf-8
# End:
# vim: filetype=make fileencoding=utf-8 :
